﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Reflection;
using Yitter.IdGenerator;

namespace HiSport.Core.Entities
{
    /// <summary>
    /// A shortcut of <see cref="Entity{TPrimaryKey}"/> for most used primary key type (<see cref="int"/>).
    /// </summary>
    [Serializable]
    public abstract class Entity : Entity<long>, IEntity<long>
    {

    }

    /// <summary>
    /// Basic implementation of IEntity interface.
    /// An entity can inherit this class of directly implement to IEntity interface.
    /// </summary>
    /// <typeparam name="TPrimaryKey">Type of the primary key of the entity</typeparam>
    [Serializable]
    public abstract class Entity<TPrimaryKey> : IEntity<long>
    {


        /// <summary>
        /// Unique identifier for this entity.
        /// </summary>

        [SugarColumn(ColumnDataType = "bigint", IsPrimaryKey = true, ColumnDescription = "主键", IsNullable = false)]
        public virtual long Id { get; set; }

    }
}
